﻿using UnityEngine;
using System.Collections;

public class TimerScript : MonoBehaviour {

    public int maxTime;
    int finishTime, restTime;
	// Use this for initialization
	void Start () 
    {
        finishTime = (int)Time.time + maxTime;
	}
	
	// Update is called once per frame
	void Update () 
    {
        restTime = finishTime - (int)Time.time;
        this.gameObject.GetComponent<GUIText>().text = restTime.ToString();
	}
}
